<?php
/**
 * Utilities functions
 * 
 * @package   
 * @author Nuar H. Noah
 * @copyright Nuar H. Noah <nhnoah+msys@gmail.com>
 * @version CVS: $Id: utils.php 6 2011-11-20 20:13:31Z NHNOAH@gmail.com $
 * @access public
 */
 */

function _is(&$check, $alternate = NULL){ 
    return (isset($check)) ? (empty($check) ? $alternate : $check) : $alternate; 
}

function get_base_uri($str, $type = false){
    
    $uri = BASE_URI;
    
    switch ($type){
        case 'admin': $uri = BASE_URI.'admin_login.php'; break;
        case 'css': $uri = CSS_URI; break;
    }    
    return $uri.$str;    
}

function get_stylesheet_color_scheme_link(){
    return get_base_uri('style-'.$_SESSION['color_scheme_session'].'.css','css');
}

function get_header_title($url_folder){
    $str = "Index of: home/";
    return (empty($url_folder)) ? $str : $str.$url_folder."/"; 
}

function get_hash_uri($str){
    return base64_decode(trim($str));
}

?>